import vue from '@vitejs/plugin-vue'

import createAutoImport from './plugins/auto-import.js'
import createSetupExtend from './plugins/setup-extend.js'
import createCompression from './plugins/compression.js'
import vantComment from './plugins/vant-comment.js'
import createSvgIcons from './plugins/Icon_plugin.js'
//import singlefile from './plugins/plugin-singlefile.js'
// 加载插件入口
export default function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = [vue()]
  vitePlugins.push(createAutoImport())
  vitePlugins.push(createSetupExtend())
  vitePlugins.push(createSvgIcons())
  vitePlugins.push(vantComment())
 //vitePlugins.push(singlefile())
  isBuild && vitePlugins.push(...createCompression(viteEnv))
  return vitePlugins
}
